@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    color: #fff;
    font-family: 'Orbitron', monospace;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 60%, #8B4513 60%, #228B22 100%);
}

#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #0ff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    pointer-events: auto;
}

.menu-button {
    background: #0ff;
    color: #000;
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 5px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-button:hover {
    background: #fff;
    transform: scale(1.1);
}

#gameUI {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.9));
    border-top: 3px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.speedometer {
    width: 120px;
    height: 120px;
    border: 4px solid #0ff;
    border-radius: 50%;
    position: relative;
    background: radial-gradient(circle, #222, #111);
}

.speedometer-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 50px;
    background: #ff0;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    transition: transform 0.1s;
}

.speedometer-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #0ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.gear-display {
    font-size: 48px;
    color: #0ff;
    text-align: center;
    margin: 0 40px;
}

.race-info {
    text-align: right;
    line-height: 1.5;
}

#garage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    pointer-events: auto;
}

#garageCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    cursor: pointer;
}

.garage-ui {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.garage-title {
    font-size: 3em;
    color: #0ff;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #0ff;
    font-family: 'Orbitron', monospace;
    font-weight: 900;
}

.car-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #0ff;
    text-align: center;
    min-width: 300px;
    z-index: 10;
    pointer-events: none;
}

.car-name {
    font-size: 1.5em;
    color: #0ff;
    margin-bottom: 10px;
    font-weight: 700;
}

.car-description {
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.4;
}

.car-stats-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.8em;
    color: #aaa;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2em;
    color: #0ff;
    font-weight: 700;
}

.upgrade-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.upgrade-title {
    font-size: 1.2em;
    color: #0ff;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
}

.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.upgrade-item {
    background: rgba(0, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #0ff;
    text-align: center;
}

.upgrade-name {
    font-size: 1em;
    color: #0ff;
    margin-bottom: 5px;
    font-weight: 700;
}

.upgrade-level {
    font-size: 0.9em;
    color: #fff;
    margin-bottom: 10px;
}

.upgrade-btn {
    background: #0ff;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.8em;
}

.upgrade-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

.upgrade-btn:disabled {
    background: #666;
    color: #333;
    cursor: not-allowed;
    transform: none;
}

.upgrade-btn:disabled:hover {
    background: #666;
    transform: none;
}

.garage-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    pointer-events: auto;
}

.garage-button {
    background: #0ff;
    color: #000;
    border: none;
    padding: 15px 30px;
    margin: 5px;
    border-radius: 5px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
    display: block;
    width: 150px;
}

.garage-button:hover {
    background: #fff;
    transform: scale(1.05);
}

.garage-button.selected {
    background: #ff0;
    color: #000;
}

.garage-button:disabled {
    background: #666;
    color: #333;
    cursor: not-allowed;
    transform: none;
}

.tuning-section {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #0ff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    pointer-events: auto;
    z-index: 1000;
    display: none;
    min-width: 500px;
}

.tuning-title {
    font-size: 2em;
    color: #0ff;
    margin-bottom: 30px;
    font-weight: 900;
}

.tuning-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.tuning-item {
    background: rgba(0, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #0ff;
    text-align: center;
}

.tuning-item-name {
    font-size: 1.2em;
    color: #0ff;
    margin-bottom: 10px;
    font-weight: 700;
}

.tuning-item-level {
    font-size: 1em;
    color: #fff;
    margin-bottom: 15px;
}

.tuning-item-btn {
    background: #0ff;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
    width: 100%;
}

.tuning-item-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

.tuning-item-btn:disabled {
    background: #666;
    color: #333;
    cursor: not-allowed;
    transform: none;
}

#mobileControls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 100px;
    height: 100px;
    display: none;
}

.hidden {
    display: none !important;
}

